*Table 1*
tab gender_leader female, col chi2

*Table 2*
ttest gender_leader, by(female)
ttest gender_leader if currentpresmun_female==1, by(female)
ttest gender_leader if currentpresmun_female==0, by(female)
ttest gender_leader if female==1, by(currentpresmun_female)
ttest gender_leader if female==0, by(currentpresmun_female)

*Table 3, Model 1*
estsimp ologit gender_leader male currentpresmun_female male_femalepresmun  seguro_barrio ///
qualityeducation indigena_sum religiosity rural pandummy pridummy otherparty nonpartisan ///
ideology ideology_dk age ed laborforceratio pm_pan pm_prd pm_panprd pm_other_id, cluster(municipio) genname(newvar)

setx median
*Female, no female mayor
setx (currentpresmun_female)0 (male)0 (male_femalepresmun)0
simqi, pr
*Female, female mayor
setx (currentpresmun_female)1 (male)0 (male_femalepresmun)0
simqi, pr
*male, no female mayor
setx (currentpresmun_female)0 (male)1 (male_femalepresmun)0
simqi, pr
*male, female mayor
setx (currentpresmun_female)1 (male)1 (male_femalepresmun)1
simqi, pr

setx median
setx (religiosity)1
simqi, pr
setx (religiosity)2
simqi, pr
setx (religiosity)3
simqi, pr
setx (religiosity)4
simqi, pr

*Table 3, Model 2*
ologit gender_leader male pastfemalemayor male_pastfemalemayor seguro_barrio ///
qualityeducation indigena_sum religiosity rural pandummy pridummy otherparty nonpartisan ///
ideology ideology_dk age ed laborforceratio pm_pan pm_prd pm_panprd pm_other_id ///
if currentpresmun_female==0, cluster(municipio)

*Table 3, Model 3*
ologit gender_leader male morethan1v_none male_morethanone seguro_barrio ///
qualityeducation indigena_sum religiosity rural pandummy pridummy otherparty nonpartisan ///
ideology ideology_dk age ed laborforceratio pm_pan pm_prd pm_panprd pm_other_id, cluster(municipio)
